using System;
using System.IO;
using UnityEngine;

namespace BToolkit.ExeUtils
{
    public class Logger
    {
        public static void Log(object content)
        {
            string path = Application.dataPath + "/../log.txt";
            string contentOrigin = "";
            if (File.Exists(path))
            {
                contentOrigin = File.ReadAllText(path);
            }
            if (!string.IsNullOrEmpty(contentOrigin))
            {
                contentOrigin += "\n";
            }
            contentOrigin += "["+DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff") +"] " + content.ToString();
            File.WriteAllText(path, contentOrigin);
        }
    }
}